package org.elec.mac.service;


import org.elec.mac.entity.SysRoleUser;
import org.elec.mac.mapper.SysRoleUserMapper;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Description:实现类
 * @author 
 * @version 1.0
 * @created 
 */
@Service
public class SysRoleUserService extends BaseService<SysRoleUser, SysRoleUserMapper> implements InitializingBean {

	@Autowired
	private SysRoleUserMapper sysRoleUserMapper;
	
	public void afterPropertiesSet() throws Exception {
		this.setBaseMapper(sysRoleUserMapper);
	}

	/**
	 * 根据用户ID删除用户拥有角色
	 * @param param
	 * @return
	 */
	public int deleteSysRoleUserByUserId(Map<String, Object> param) {
		return sysRoleUserMapper.deleteSysRoleUserByUserId(param);
	}

	/**
	 * 根据角色ID删除用户拥有角色
	 * @param param
	 * @return
	 */
	public int deleteSysRoleUserByRoleId(Map<String, Object> param) {
		return sysRoleUserMapper.deleteSysRoleUserByRoleId(param);
	}

}
